package com.sinoair.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 基本的跳转
 */
@Controller
public class BaseController {


    /**
     * 基本跳转，如果>目录结构跳转
     * /to_page/plugins>layui>button
     * @param pageName 要跳转的页面名
     * @return 文件名
     */
    @RequestMapping(value = "/to_page/{pageName}", method = RequestMethod.GET)
    public String toPage(@PathVariable String pageName) {
        if (pageName != null && pageName.indexOf(">") > 0) {
            return pageName.replace(">", "/");
        }
        return pageName;
    }


}
